using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using KFGame;

public class KFTicketDevice : MonoBehaviour
{
    public Text toSend;
    public Text beSend;

    int totSend = 0;
    int betSend = 0;

    KF kF;

    void Awake()
    {
        kF = KF.Instantiation();


    }

    void close()
    {

    }

    KFTicketDeviceIOCOM com;
    void Start()
    {
        clean();

        com = gameObject.AddComponent<KFTicketDeviceIOCOM>();
        com.init();
        com.onSendTicket += overSend;

    }


    void overSend(string name, int num)
    {
        Debug.Log("view receview " + num);
        betSend += num;
        beSend.text = "" + betSend;
    }



    public void clean()
    {
        totSend = 0;
        betSend = 0;
        toSend.text = "" + totSend;
        beSend.text = "" + betSend;
    }

    public void sendbtn1()
    {
         

        totSend += 1;
        toSend.text = "" + totSend;
        com.send(1);
    }
    public void sendbtn2()
    {
        
        totSend += 5;
        toSend.text = "" + totSend;
        com.send(5);
    }
    public void sendbtn3()
    {
        

        totSend += 11;
        toSend.text = "" + totSend;
        com.send(11);
    }
}
